package com.mxpio.erp.common.technology.entity;

import com.mxpio.erp.common.equipment.entity.Equipment;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.List;

/**
 * @Author : wpp
 * @Datetime : 2023/7/28 10:27
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc :
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_TECHNOLOGY_PROCESSINFO")
@Schema(description="工序信息")
public class ProcessInfo extends BaseEntity {

    private static final long serialVersionUID = 1L;
    /**工序编码*/
    @Id
    @Column(name = "PROCESS_CODE_", updatable = false)
    @Schema(description  = "工序编码")
    private String processCode;
    /**工序名称*/
    @Column(name = "PROCESS_NAME_" )
    @Schema(description  = "工序名称")
    private String processName;
    /**工艺描述*/
    @Column(name = "CRAFT_DESC_" )
    @Schema(description  = "工艺描述")
    private String craftDesc;
    /**工序类型*/
    @Column(name = "PROCESS_TYPE_")
    @Schema(description  = "工序类型")
    @Dict(dicCode = "ERP_TECH_PROC_TYPE")
    private Integer processType;
    /**工序分类*/
    @Column(name = "PROCESS_CLASS_" )
    @Schema(description  = "工序分类")
    @Dict(dicCode = "ERP_TECH_PROC_CLASS")
    private Integer processClass;

    @Column(name = "WKSHOP_CODE_" )
    @Schema(description  = "所属车间")
    @Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
    private String wkshopCode;

    @Column(name = "MANUFACTURE_ABLE_")
    @Schema(description = "可自制")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String manufactureAble;

    @Column(name = "OUTSOURCE_ABLE_")
    @Schema(description = "可委外")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String outsourceAble;

    /**是否启用*/
    @Column(name = "STATUS_")
    @Schema(description = "是否启用")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String status;

    @Column(name = "BATCH_REPORT_ABLE")
    @Schema(description  = "批次报工")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String batchReportAble;

    @Column(name = "TOLERANCE_RANGE_")
    @Schema(description  = "允许误差范围(%)")
    private String toleranceRange;

    @Column(name = "AUTO_REPORT_ABLE")
    @Schema(description  = "自动报工")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String autoReportAble;

    @Column(name = "REPORT_MODE_")
    @Schema(description  = "报工方式")
    @Dict(dicCode = "ERP_TECH_REPORT_MODE")
    private String reportMode;

    @Column(name = "DOC_FILE_",length = 500)
    @Schema(description = "工艺文件路径")
    private String docFile;

    @Column(name = "FINISH_CHECK_FLAG_")
    @Schema(description = "是否完工检")
    @Dict(dicCode = "ERP_COMMON_YESNO")
    private String finishCheckFlag;

    @Column(name = "EQP_CODE_")
    @Schema(description = "设备编码")//设备
    @Dict(dicCode="eqpCode", dicEntity = Equipment.class, dicText = "eqpName")
    private String eqpCode;

    @Column(name = "EQP_NAME_")
    @Schema(description = "设备名称")
    private String eqpName;
    @Transient
    private List<ProcessDevice> deviceList;
}
